﻿<%@ Page Language="C#" MasterPageFile="~/ManageCenter/SystemSetMaster.master" AutoEventWireup="true" CodeFile="ManageStreetName.aspx.cs" Inherits="ManageCenter_ManageStreetName" Title="住房保障管理中心" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div style="float:right;">
        <asp:Button ID="btnaddnew" runat="server" Text="新增" Width="81px" OnClick="btnaddnew_Click" /></div>
    <br />
    <asp:GridView ID="gvshowrecord" runat="server" AllowPaging="True" AutoGenerateColumns="False"
        CssClass="GridViewStyle" EmptyDataText="记录" PagerSettings-Visible="false"
        Width="100%" DataKeyNames="str_id" DataSourceID="SqlDataSource1">
        <PagerSettings Visible="False" />
        <FooterStyle CssClass="FooterStyle" />
        <EmptyDataRowStyle CssClass="EmptyRowStyle" />
        <RowStyle CssClass="RowStyle" />
        <EditRowStyle CssClass="EditRowStyle" />
        <SelectedRowStyle CssClass="SelectedRowStyle" />
        <PagerStyle CssClass="PagerStyle" />
        <HeaderStyle CssClass="HeaderStyle" />
        <AlternatingRowStyle CssClass="AltRowStyle" />
        <Columns>
            <asp:BoundField DataField="str_id" HeaderText="记录号" InsertVisible="False" ReadOnly="True"
                SortExpression="str_id" />
            <asp:BoundField DataField="str_streetname" HeaderText="街道" SortExpression="str_streetname" />
            <asp:BoundField DataField="str_noid" HeaderText="编号" SortExpression="str_noid" />
            <asp:BoundField DataField="str_letter" HeaderText="字" SortExpression="str_letter" />
            <asp:CommandField HeaderText="操作" ShowDeleteButton="True" ShowEditButton="True" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SqlConnection %>"
        DeleteCommand="DELETE FROM StreetNumId WHERE (str_id = @str_id)"
        SelectCommand="SELECT str_id, str_streetname, str_letter, str_noid FROM StreetNumId"
        UpdateCommand="UPDATE StreetNumId SET str_noid = @str_noid, str_streetname = @str_streetname, str_letter = @str_letter WHERE (str_id = @str_id)">
        <DeleteParameters>
            <asp:Parameter Name="id" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="str_noid" />
            <asp:Parameter Name="str_streetname" />
            <asp:Parameter Name="str_letter" />
            <asp:Parameter Name="str_id" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <br />
    <div style="width:400px; margin:auto; font-size:15px" runat="server" id="add">
        街道名：
        <asp:TextBox ID="txbname" runat="server" Width="164px"></asp:TextBox>
        <asp:RequiredFieldValidator ID="rfname" runat="server" ErrorMessage="*" ControlToValidate="txbname"></asp:RequiredFieldValidator><br />
        编 &nbsp;号：
        <asp:TextBox ID="txbnoid" runat="server" Width="164px"></asp:TextBox>
        <asp:RequiredFieldValidator ID="rfnoid" runat="server" ErrorMessage="*" ControlToValidate="txbnoid"></asp:RequiredFieldValidator><br />
        &nbsp;&nbsp; 字 ：
        <asp:TextBox ID="txbletter" runat="server" Width="163px"></asp:TextBox><br />
        <br />
        &nbsp; &nbsp; &nbsp; &nbsp;<asp:Button ID="btnaddstreet" runat="server" OnClick="btnaddstreet_Click"
            Text="添 加" Width="64px" /></div>
</asp:Content>

